package com.zyf.temple.server;

import com.zyf.temple.model.TempleUser;
import com.zyf.temple.repository.UserRepositiry;
import com.zyf.temple.response.BaseServerImplResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import sun.awt.SunHints;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class UserServerImpl implements UserServer {


    @Resource
    public UserRepositiry userRepositiry;

    @Override
    public BaseServerImplResponse.BaseServerImplResponseBuilder CreatUser(TempleUser templeUser) {
        //创建用户的时候，应该需要判断数据库里面是否存在，如果存在就提示用户

        userRepositiry.save(templeUser);
        BaseServerImplResponse.BaseServerImplResponseBuilder builder = BaseServerImplResponse.builder();
        return builder;

    }
}
